﻿<%@ Page Title="Quản lý đơn hàng" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/OutSite.Master" CodeBehind="CusBillManager.aspx.vb" Inherits="Core.CusBillManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript">
    function showDetail(id) {
        //alert(id);
        $("#div" + id).slideToggle("normal", function () {
            if ($("#div" + id).css("display") == 'none') {
                $("#ctl00_ContentPlaceHolder1_gridBill_ctl" + id + "_imgToggle").attr("src", "static/outSite/images/collapse_add.png");
                
            } else {
                $("#ctl00_ContentPlaceHolder1_gridBill_ctl" + id + "_imgToggle").attr("src", "static/outSite/images/collapse_minus.png");

            }
        });
        return false;
    }
</script>

<div class="boxPro">
	<div class="boxNew_header">Quản lý đơn hàng</div>
    <asp:GridView ID="gridBill" runat="server" class="tblMain" AutoGenerateColumns="false" GridLines="None" HeaderStyle-Height="25px" 
        HeaderStyle-BackColor="#d7d7d7" Width="570px" RowStyle-Height="25px" DataKeyNames="BillID">
        <EmptyDataTemplate>
            <asp:Label ID="lblEmptySearch" runat="server" ForeColor="Red">Bạn chưa có đơn hàng !!!</asp:Label>
        </EmptyDataTemplate>
        <Columns>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <asp:ImageButton ID="imgToggle" runat="server" ImageUrl="~/static/outSite/images/collapse_add.png" CssClass="noneCSS" Width="20px"/>
                    
                </ItemTemplate>
                <HeaderStyle Width="30px" HorizontalAlign="Center" />
                <ItemStyle Width="30px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="No.">
                <ItemTemplate>
                    <asp:Label Visible="false" runat="server" ID="lbl_ID" Text='<%#Eval("BillID") %>'></asp:Label>
                    <asp:Label runat="server" ID="lblSTT" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                    
                </ItemTemplate>
                <HeaderStyle Width="30px" HorizontalAlign="Center" />
                <ItemStyle Width="30px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Mã đơn hàng">
                <ItemTemplate>
                    <asp:Label Visible="true" runat="server" ID="lbl_BillID" Text='<%#Eval("BillID") %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Width="170px" HorizontalAlign="Center" />
                <ItemStyle Width="170px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ngày đặt" SortExpression="BillDate">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblBillDate" Text='<%#formatTime(Eval("BillDate")) %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="140" HorizontalAlign="Left" />
                    <ItemStyle Width="140" />
                </asp:TemplateField>
            <asp:TemplateField HeaderText="Tổng tiền" SortExpression="BillTotal">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblBillTotal" Text='<%#formatCurrency(Eval("BillTotal")) %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Width="100" HorizontalAlign="Right" />
                <ItemStyle Width="100" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Trạng thái" SortExpression="BillStatus">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblBillStatus" Text='<%#formatStatus(Eval("BillStatus")) %>'></asp:Label>
                </ItemTemplate>
                <HeaderStyle Width="140" HorizontalAlign="Center" />
                <ItemStyle Width="140" HorizontalAlign="Center"/>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>  
                    </td></tr>  
                    <tr>  
                <td colspan="100%" style="padding: 0px;"><div id="div<%#(Container.DataItemIndex + 2).ToString("00") %>" style="display:none;">  
                    <asp:GridView ID="gridChild" runat="server" class="tblChild" 
                        AutoGenerateColumns="False" GridLines="None"
                        DataKeyNames="BillDetailID" Width="100%" 
                        AlternatingRowStyle-BackColor="#f3f9fe"
                        RowStyle-BackColor="#ffffcc"
                        > 
                        <EmptyDataTemplate>
                            <asp:Label ID="lblEmptySearch" runat="server" ForeColor="Red">Không có sản phẩm phù hợp</asp:Label>
                        </EmptyDataTemplate>
                        <Columns>
                            <asp:TemplateField HeaderText="">
                                <ItemTemplate>
                                    <asp:Label Visible="false" runat="server" ID="lblNo" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle Width="50px" HorizontalAlign="Left" BackColor="#efefef" />
                                <ItemStyle Width="50px" BackColor="#efefef" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên SP">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbName" Text='<%#Eval("ProName") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left"/>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Giá SP">
                                <ItemStyle Width="80px" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_Price" Text='<%#formatCurrency(Eval("ProNewPrice")) %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Right" />
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Số lượng">
                                <ItemStyle Width="80px" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_Price" Text='<%#Eval("BillDetailCnt") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="center" />
                                <ItemStyle HorizontalAlign="center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Thành tiền">
                                <ItemStyle Width="80px" />
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_Price" Text='<%#formatCurrency(Eval("Total")) %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Right" />
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle HorizontalAlign="Center" CssClass="subPageFunction" />
                    </asp:GridView>
                </div></td></tr> 
                
                </ItemTemplate> 
            </asp:TemplateField>   
        </Columns>
    </asp:GridView>
</div>
<div style="height: 10px;float: left;width: 100%;"></div>
<div style="text-align:center;margin-top:10px;">
    <input type="button" value="Quay lại" class="btnInput cancelType" onclick="history.go(-1);" />
</div>

</asp:Content>
